-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for TUSB_REQ_FEATURE_TEST_MODE #2413
Conversation
I was also working on a test mode support for TinyUSB. 😃 You can check it out here: #2416 My comments about your implementation:
I like the control callback handling, better than my event workaround. |
Hi @Rocky04, I saw your PR. I agree with your comments about not handling wLength=0 and returning stall if the device doesn't handle test mode. |
I borrowed some of your ideas and already changed my implementation. The entering of the test mode needs to be done after the request has finished. Using the control complete callback is a great way of ensuring that. Otherwise the device is in the test mode before the host got the acknowledgement. So that the test mode already took over the signaling and the host request times out. I already saw people who do signaling tests only relying on the shown status of the compliance tool. They thought it was working only because the tool stated a success even the device never actually entered the test mode, only because the device blindly acknowledged the request. |
Closing since duplicate of #2416 |
Describe the PR
Adds support for TUSB_REQ_FEATURE_TEST_MODE feature in usbd.c
Additional context
Added callback functions tud_test_mode_req_status_xfer_cb(), usbd_set_test_mode() and dcd_set_test_mode() that are
called to transition the USB device into the electrical compliance test mode.